home *** CD-ROM | disk | FTP | other *** search
/ Champak 120 / Vol 120.iso / games / space_bo.swf / scripts / DefineSprite_197 / frame_1 / DoAction.as
Encoding:
Text File  |  2010-11-09  |  1.0 KB  |  40 lines

  1. function rikHit()
  2. {
  3.    var _loc1_ = _parent;
  4.    if(hitCount > 0)
  5.    {
  6.       hitCount--;
  7.    }
  8.    rikX = Math.abs(this._x - 125);
  9.    rikY = Math.abs(this._y - _loc1_.rik._y - 20);
  10.    if(rikX < 25 and rikY < 50)
  11.    {
  12.       if(_loc1_.riciclesCollected > 0)
  13.       {
  14.          anim.ricicle.gotoAndPlay(2);
  15.          _loc1_.riciclesCollected = _loc1_.riciclesCollected - 1;
  16.       }
  17.       _loc1_.rikStatus = "HIT";
  18.       _loc1_.speed = 0;
  19.       _loc1_.boost = 0;
  20.       _loc1_.flameLevel = 0;
  21.       if(_loc1_.rikFrame <= 6)
  22.       {
  23.          _loc1_.rik.anim.gotoAndPlay("rightHit");
  24.       }
  25.       else
  26.       {
  27.          _loc1_.rik.anim.gotoAndPlay("leftHit");
  28.       }
  29.       hitCount = 10;
  30.    }
  31. }
  32. alienCol = new Color(anim);
  33. alienColTransform1 = new Object();
  34. alienColTransform1 = {ra:"100",rb:"0",ga:"100",gb:"0",ba:"100",bb:"0",aa:"100",ab:"0"};
  35. alienColTransform2 = new Object();
  36. alienColTransform2 = {ra:"100",rb:"0",ga:"100",gb:"0",ba:"100",bb:"100",aa:"100",ab:"0"};
  37. sfxAlien = new Sound(this);
  38. sfxAlien.attachSound("sfxAlien");
  39. play();
  40.